package com.brush.system.domain.req.sysrole;

import cn.hutool.core.util.StrUtil;
import com.brush.common.core.domain.page.PageAbstructReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Date;

/**
 * ClassName: SysRoleQueryReq
 * Package: com.brush.system.domain.req.sysrole
 * Description:
 *
 * @Author luo
 * @Create 2024/8/25 16:01
 * @Version 1.0
 */
@Getter
@Setter
@ToString(callSuper = true)
@ApiModel(value = "SysRoleQueryReq", description = "角色查询请求对象")
public class SysRoleQueryReq extends PageAbstructReq {

    /**
     * 角色id
     */
    @ApiModelProperty(value = "角色id")
    private Integer roleId;

    /**
     * 角色名称
     */
    @ApiModelProperty(value = "角色名称")
    private String roleName;

    /**
     * 角色权限
     */
    @ApiModelProperty(value = "角色权限")
    private String roleKey;

    /**
     * 角色排序
     */
    @ApiModelProperty(value = "角色排序")
    private Integer roleSort;

    /**
     * 角色状态
     */
    @ApiModelProperty(value = "角色状态")
    private String status;

    /**
     * 创建时间
    */
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 开始时间
     */
    @ApiModelProperty(value = "开始时间")
    private Date beginTime;

    /**
     * 结束时间
     */
    @ApiModelProperty(value = "结束时间")
    private Date endTime;



    /**
     * 排序
     * @return
     */
    @ApiModelProperty(hidden = true)
    @Override
    public String getOrderBy() {
        if (StrUtil.isNotBlank(super.getOrderByColumn())){
            return super.getOrderByColumn() + " " + super.getIsAsc();
        }
        return null;
    }
}
